package com.moss.cloud.remote.biz.controller;

import com.moss.cloud.common.core.constant.ServiceList;
import com.moss.cloud.common.core.model.Result;
import com.moss.cloud.remote.api.model.from.IPAddrFrom;
import com.moss.cloud.remote.biz.service.IPService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(ServiceList.REMOTE + "/ip")
public class IPAddrController {

    @Autowired
    IPService ipService;
    /**
     * 获取IP地址信息
     *
     * @param from
     * @return
     */
    @PostMapping("/getIpAddr")
    public Result<?> getIpAddr(@RequestBody @Validated IPAddrFrom from){
        return Result.success(ipService.getIpAddr(from));
    }

}

